package com.izhaowo.recommend.job;

import com.izhaowo.recommend.contrl.RecommendWeddingPlanner;
import com.izhaowo.recommend.util.HBaseUtil;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by HASEE on 2019/7/18.
 */
public class TestServcie {
//    public void doTest() throws Exception {
//        HBaseUtil.init("47.104.171.235:2181");
//        String[] cf = new String[1];
//        cf[0] = "cf";
//        HBaseUtil.createTable("mytest", cf, true);
//    }

    public static void main(String[] args) throws Exception {
//        SystemPropertie
//        HBaseUtil.init("hadoop001");
        HBaseUtil.init("hadoop004");
        RecommendWeddingPlanner np = new RecommendWeddingPlanner();
//        System.out.println(np.getUserWeddingById("81c21a9d-2e93-4be3-a9d3-cf728cf3543c"));
//        System.out.println(np.getWorkerIdByUserId("54fccbf1-830f-4c50-b6a3-727e17b50c31"));
//        System.out.println(np.getWorkerVOById("00e2698c-cfb6-4c7d-a86c-1a1318821db9").getName());
//        System.out.println(np.getNameWorkers().size());

//        List<WorkerVO> list = new ArrayList<>();
//        WorkerVO vo = new WorkerVO();
//        vo.setId("");
//        list.add(vo);
//        System.out.println(np.getWorkerScheduleDates(list, "23815855-b8b9-481a-8f7a-a68037a23456").size());


        List<String> ids = new ArrayList<>();
//        ids.add("f8c908eb-991f-11e6-8097-ecf4bbbfcdb8");
//        ids.add("96e08446-ce3f-49da-89e1-678831ebf8ee");
        ids.add("923473d1-52a7-4c53-8426-754d85b22b50");
//        System.out.println(np.getWorkerServices(ids).siz1e());
//        System.out.println(np.getWorkerWeddingOrder(ids, "2018", "0").values().size());
//        System.out.println(np.getWorkerVOById("00e2698c-cfb6-4c7d-a86c-1a1318821db9"));
//        Result r = HBaseUtil.getRow("rp_tb_user_wedding", Bytes.toBytes("81c21a9d-2e93-4be3-a9d3-cf728cf3543c"));
//        Cell c = r.getColumnLatestCell(Bytes.toBytes("info"), Bytes.toBytes("contacts_msisdn"));
//        r.getValue(Bytes.toBytes("info"), Bytes.toBytes("contacts_msisdn"));
//        r.getValue(Bytes.toBytes("info"), Bytes.toBytes("user_id"));
//        System.out.println(Bytes.toString(r.getValue(Bytes.toBytes("info"), Bytes.toBytes("user_id"))));
//        HBaseUtil.init("47.104.132.121");
//        System.out.println(HBaseUtil.getTable("workers_hotel_distance"));
//        System.out.println(HBaseUtil.getRow("US_POPULATION", Bytes.toBytes("81c21a9d-2e93-4be3-a9d3-cf728cf3543c")));
//        String[] cf = new String[1];
//        cf[0] = "cf";
//        HBaseUtil.createTable("mytest", cf, true);
//        ResultScanner scanner = HBaseUtil.get("workers_hotel_distance");
//        Iterator<Result> it = scanner.iterator();
//        while (it.hasNext()) {
//            Result r = it.next();
//            System.out.println(r.getRow());
//        }

//        HBaseUtil.getRow("workers_hotel_distance", Bytes.toBytes("-4877093028053774069"));


    }


}
